package cz.mpelant.msoe.mealchecker.downloader;


public class URLBuilder {
	private String baseUrl;
	private String parameters="";
	public URLBuilder(String baseUrl){
		this.baseUrl=baseUrl;
	}
	public URLBuilder addParameters(String name, String value){
		if(parameters.length() == 0)
			parameters="?";
		else
			parameters+="&";
		parameters+=name+"="+value;
		return this;
	}

	public String getBaseUrl() {
		return baseUrl;
	}
	public void setBaseUrl(String baseUrl) {
		this.baseUrl = baseUrl;
	}
	public String getParameters() {
		return parameters;
	}
	public void setParameters(String parameters) {
		this.parameters = parameters;
	}
	@Override
	public String toString() {
		return baseUrl+parameters;
	}

}
